package designpattern.myproxy;

import java.lang.reflect.Method;

public class CustomProxyMeiPo implements LINInvocationHandler{
    private  Object object;
    public Object newProxyInstance(Object object) throws Exception {
        this.object = object;
        return LINProxy.newProxyInstance(new LINClassLoader(), object.getClass().getInterfaces(), this);
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("执行前....");
        method.invoke(object,args);
        System.out.println("执行后....");
        return null;
    }
}
